<!DOCTYPE html>
<html lang="en">
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div th:include="/nav.html"></div>
<h1>教师管理</h1><hr>
<div style="display: flex">
  <div style="width: 70%">
    <table class="table" style="width: 90%">
      <tr>
        <td>教师ID</td>
        <td>教师名称</td>
        <td>手机号</td>
        <td>头像</td>
        <td>更改</td>
        <td>删除</td>
      </tr>
      <tr th:each="tea : ${users}">
        <td th:text="${tea.uid}"></td>
        <td th:text="${tea.uname}"></td>
        <td th:text="${tea.phone}"></td>
        <td style="width: 8%;height: 8%">
          <img style="width: 100%;height: 100%" th:src="'/home/showImg/'+${tea.pic}">
        </td>
        <td><a th:href="'/adm/tea/go2update/'+${tea.uid}">更改</a></td>
        <td><a th:href="'/adm/tea/delete/'+${tea.uid}">删除</a></td>
      </tr>
    </table>
  </div>
  <div style="width: 25%">
    <p th:text="${function}"></p><hr>
    <form style="width: 75%" th:action="'/adm/tea/'+${method}" method="post" enctype="multipart/form-data">
      <input type="hidden" name="uid" th:value="${teacher.uid}">
      <p>姓名：<input type="text" name="uname" th:value="${teacher.uname}"></p>
      <p>电话：<input type="text" name="phone" th:value="${teacher.phone}"></p>
      <p>密码：<input type="text" name="pwd" th:value="${teacher.pwd}"></p>
      <input type="hidden" name="pic" th:value="${teacher.pic}">
      <p th:if="${method}=='update'" style="width: 20%;height: 20%">
        <img style="width: 100%;height: 100%" th:src="'/home/showImg/'+${teacher.pic}">
      </p>
      <p>请选择图片：<input name="file" type="file" value=""> </p>
      <p><input type="submit"></p>
    </form>

  </div>
</div>
</body>
</html>